using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       GSRole_Enter_FailedSender.cs
*@brief      send message GSRole_Enter_Failed
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/26
*/

//send message GSRole_Enter_Failed
public class msgGSRole_Enter_Failed
{
    public const int MessageId = (int)GameServerTypes.MessageType.GSRole_Enter_Failed;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public gameserver.RoleEnterFailed MsgContent = new gameserver.RoleEnterFailed();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgGSRole_Enter_Failed"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='gate_code'>
	/// Gate_code.
	/// </param>
	/// <param name='error'>
	/// Error.
	/// </param>
	public msgGSRole_Enter_Failed(int session_id, int gate_code, gatewayserver.EnterFailed.eErrorCode error)
	{
		SessionId = session_id;
		MsgContent.GateCode = gate_code;
		MsgContent.ErrorCode = error;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of GSRole_Enter_Failed</param>
    public static void ProcessMessage(msgGSRole_Enter_Failed msg)
    {
        //TODO
        //Main Message:  msgGameServer
		msgGameServer mainMsg = new msgGameServer(msg.SessionId, msgGSRole_Enter_Failed.MessageId, ProtoNet<gameserver.RoleEnterFailed>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
